package com.ailk.emall.system.interceptors;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import com.ailk.emall.utils.SessionUtil;

/** 
 * 
 * @author zhaowg3
 * @Date 2017年1月7日
 */
public class LoginInterceptor extends HandlerInterceptorAdapter {

	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {
		//判断session是否失效
		if(SessionUtil.isSessionExp(request.getSession())){
			response.sendRedirect("../login/login");
			return false;
		}
		return true;
	}

}
